package com.ldq.imooc.basics.io;

import java.io.*;

/**
 * @Author : 李道泉
 * @Description :字符流过滤器
 * @Date : 2018/4/17 15:16
 * @Modified by :
 */
public class BrAndBworPwDemo {

    public static void main(String[] args) throws IOException {

        //对文件进行读写操作
        BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream("F:\\IO\\io.txt")));
//        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("F:\\IO\\io22.txt")));
        PrintWriter pw = new PrintWriter("\"F:\\\\IO\\\\io22.txt\"");
        String line;
        while ((line = br.readLine()) != null) {
            //一次读一行
            System.out.println(line);
//            bw.write(line);
            //换行
//            bw.newLine();
//            bw.flush();
            pw.print(line);
            pw.println(line);
            pw.flush();
        }
        br.close();
//        bw.close();
        pw.close();
    }
}
